import React from 'react';
import NavLink from '../commons/NavLink';
import {hashHistory } from 'react-router'
import { connect } from 'react-redux';
import {user_logined} from '../../actions';

const arr_right = require('!url?limit=8192&name=static/img/[hash:6].[ext]!../../static/img/arr_right.png');

var userView = React.createClass({
  confim_out:function(){
    let a= confirm('您确定要退出吗？');
    const {dispatch} = this.props;
    if(a){
      dispatch(user_logined(false,0))
      hashHistory.push('/userView/user');
    }
  },
  render:function(){

    return(
      <div className="userProblems setting">
        <div className="wrapper">
          <ul>
            <li>
              <span className="border_b1"><em>个人信息</em><var>&#9658;</var></span>
            </li>
            <li>
              <span className="border_b1"><em>意见反馈</em><var><font style={{"color":"#919191",'fontSize':'.24rem'}}>24.6M</font> &#9658;</var></span>
            </li>
            <li>
              <span className="border_b1"><em>清除缓存</em><var>&#9658;</var></span>
            </li>
            <li>
              <span className="border_b1"><em>关于美人谷</em><var>&#9658;</var></span>
            </li>
            <li>
              <span className="border_b1"><em>分享给好友</em><var>&#9658;</var></span>
            </li>
          </ul>
        </div>

        <div className="bot border_t1">
          <a href="javascript:void(0)" onClick={this.confim_out}>退出登录</a>
        </div>
      </div>
    )
  }
})

const mapStateToProps = (state) => {
  // console.log(state.user)
  let user_logined = !!state.user.user_logined || false;
  return {
    user_logined:user_logined
  }
}

export default connect(mapStateToProps)(userView)
